package net.messagenet.mazor.web.mngbeans;


import java.io.Serializable;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import net.messagenet.mazor.DO.DpaDO;
import net.messagenet.mazor.ejb.facade.MZRFacadeLocal;
import net.messagenet.mazor.exception.MZRApplicativeException;
import net.messagenet.mazor.exception.MZRInternalServerException;

import org.ajax4jsf.model.KeepAlive;
import org.apache.log4j.Logger;


@KeepAlive
public class ClosedReportsManagedBean implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5388230760485952510L;
	
	
	

	//	private UserCacheManager cacheManager;
	private MZRFacadeLocal facade=null;
	

	private Logger logger = Logger.getLogger(this.getClass());

	private List<DpaDO> dpaList;
	



	public List<DpaDO> getDpaList() {
		return dpaList;
	}

	public void setDpaList(List<DpaDO> dpaList) {
		this.dpaList = dpaList;
	}



	
	@PostConstruct
	public void init() throws MZRInternalServerException, MZRApplicativeException {
		
		InitialContext ic;
			
		try {
				ic = new InitialContext();
				facade = (MZRFacadeLocal) ic.lookup("MZRFacade/local");
			} catch (NamingException e) {
				logger.error(e.getMessage(),e);
			}

			dpaList= facade.getClosedAndNotApprovedDPAs();
	}

}

